﻿@using NewsMine.DomainObjects;
@{
    
    ViewBag.Title = "Look at news";
    // Layout = "~/Views/Shared/_Layout.cshtml";

    QResult DataFromController = (QResult)Model;

    string previousPageLink = DataFromController.CurrentUrl + "&pgno=" + (DataFromController.PageNumber - 1).ToString();
    string nextPageLink = DataFromController.CurrentUrl + "&pgno=" + (DataFromController.PageNumber + 1).ToString();


    Layout = "~/Views/Shared/_3ColumnMasterLayout.cshtml";
    
}
<script src="@Url.Content("~/scripts/blocksit.js")"></script>
<script>

    window.setInterval(yourfunction, 10000);

    function yourfunction() { $(window).resize(); }

    $(document).ready(function () {

        $('#container').BlocksIt({
            numOfCol: 4,
            offsetX: 10,
            offsetY: 10
        });

        $('#websiteContainer').BlocksIt({
            numOfCol: 5,
            offsetX: 10,
            offsetY: 10
        });

        $("#container").width = $(window).width();
        $('#websiteContainer').width = $(window).width();
        $(window).resize();

        //blocksit define
        $(window).load(function () {

            $("#container").width = $(window).width();
            $('#websiteContainer').width = $(window).width();
            $(window).resize();

            $('#container').BlocksIt({
                numOfCol: 4,
                offsetX: 10,
                offsetY: 10
            });

            $('#websiteContainer').BlocksIt({
                numOfCol: 5,
                offsetX: 10,
                offsetY: 10
            });



        });

        //window resize
        var currentWidth = $(window).width();

        $(window).resize(function () {

            $('#websiteContainer').width = $(window).width();
            $('#websiteContainer').BlocksIt({
                numOfCol: 5,
                offsetX: 10,
                offsetY: 10
            });

            var winWidth = $(window).width();
            var conWidth;
            if (winWidth < 660) {
                conWidth = 440;
                col = 2
            } else if (winWidth < 880) {
                conWidth = 440;
                col = 2;
            } else if (winWidth < 1000) {
                conWidth = 880;
                col = 4;
            } else if (winWidth < 1100) {
                conWidth = 1000;
                col = 4;
            }
            else if (winWidth > 1100) {
                conWidth = 1100;
                col = 4;
            }
            else {
                conWidth = 1100;
                col = 4;
            }

            if (conWidth != currentWidth) {
                currentWidth = conWidth;
                $('#container').width(conWidth);
                $('#container').BlocksIt({
                    numOfCol: col,
                    offsetX: 10,
                    offsetY: 10
                });
            }
        });
    });

    function rearrage() {
        var winWidth = $(window).width();
        var conWidth;
        if (winWidth < 660) {
            conWidth = 440;
            col = 2
        } else if (winWidth < 880) {
            conWidth = 440;
            col = 2;
        } else if (winWidth < 1000) {
            conWidth = 880;
            col = 4;
        } else if (winWidth < 1100) {
            conWidth = 1000;
            col = 4;
        }
        else if (winWidth > 1100) {
            conWidth = 1100;
            col = 4;
        }
        else {
            conWidth = 1100;
            col = 4;
        }

        if (conWidth != currentWidth) {
            currentWidth = conWidth;
            $('#container').width(conWidth);
            $('#container').BlocksIt({
                numOfCol: col,
                offsetX: 10,
                offsetY: 10
            });
        }
    }

</script>
<body>
    <section id="wrapper">

   
   
   @if (DataFromController.CurrentDomain != null)
   {
       <div style="text-align:center;margin-bottom:10px;border-top:3px double lightgrey;border-bottom:3px double lightgrey;">
       <h1> <img style="max-height:100px;" class="img-rounded" src="@DataFromController.CurrentDomain.Logo1Uri" />  @DataFromController.CurrentDomain.Name</h1>
       </div>
   }
           
           <div style="text-align:right;margin:15px;">
<a id="grid_view_icon" class="btn btn-large btn-inverse" href="../home/Default"  title="Grid"><i class="icon-th-large icon-white"></i> Grid</a>
<a id="list_view_icon" class="btn btn-large " href="../home/Index"  litle="List"><i class="icon-th-list"></i> List</a>
</div>      
   
 <hr />

  @RenderPage("~/views/shared/_pagerView.cshtml")

<div id="container" style="background-color:#f0f0f0;">

@{
    List<FeedItem> feeds = ((QResult)Model).FeedItems;


    string webSiteIconUrl = "https://plus.google.com/_/favicon?alt=feed&domain=eenj.net";
    
    
   @* <div class="grid" style="display:none;">
    <h2>News Sources</h2>
    
    @{
        List<NewsMine.DomainObjects.WebSiteInfo> websites = new List<NewsMine.DomainObjects.WebSiteInfo>();

        websites = ((QResult)Model).Websites;

        foreach (var website in websites)
        {
            continue;
            <h3>
        <a class='btn-link' style="margin:5px;padding-right:5px;" href="?domain=@website.Domain" >
                        <img src='https://plus.google.com/_/favicon?alt=feed&domain=@website.Domain ' style="padding-right:8px;width:20px;"/>@Html.Raw(website.Name)
                    </a>
               </h3>   
        }
            }
    </div>*@
    
    
    if (feeds == null || feeds.Count == 0)
    {
        <div class="grid">
            <h2>Feed not found for the selected criteria.</h2>
            </div>
    }

    for (int i = 0; i < feeds.Count; i++)
    {
        <div class="grid">
        
         <div class="meta" style="background-color:#77BB55;margin-top:10px;margin-left:10px;margin-right:10px;margin-bottom:-4px;padding:3px;color:White;text-align:center;">

          @if (!string.IsNullOrEmpty(feeds[i].category))
          {
        <a style="color:white" href="?id=category:@feeds[i].category.Trim(',')"><b>@feeds[i].category.Trim(',').ToUpper()</b></a>
          }

        </div>

           @if (!string.IsNullOrEmpty(feeds[i].ImageUrl))
        {

		<div class="imgholder" style="padding:10px;text-align:center;min-width:200px;min-height:100px;max-height:200px;margin-left:auto;margin-right: auto;overflow:hidden;">
			<img style="width:100%;margin-left:auto;margin-right: auto;opacity:0.95;filter:alpha(opacity=95);"  src="@feeds[i].ImageUrl" />
@*			<img style="border-radius:25px;min-width:200px;min-height:100px;max-height:200px;margin-left:auto;margin-right: auto;"  src="@feeds[i].ImageUrl" />*@
			@*<img style="border-radius:25px;min-width:200px;min-height:100px;max-height:200px;margin-left:auto;margin-right: auto;"  src="@Url.Content("~/content/img/white.gif")" data-original="@feeds[i].ImageUrl" />*@
            
            
		</div>
        }
        
        <div style="background-color:#77BB55;height:4px;margin-left:10px;margin-right:10px;margin-top:-8px;"></div>
        


         
        <div class="tile-url-content" style="overflow: hidden; line-height: 1.6; height: auto;margin-left:10px;margin-right:10px;padding:10px;font-size:20px; text-align: left;">
        <a class="name" style="text-decoration: none;color:#000;" target="_blank" href="@feeds[i].Link">
        @Html.Raw(feeds[i].Title)   </a></div>
     

       
       
          <div style="border-top:1px solid lightgrey; margin-left:10px;margin-right:10px;margin-bottom:10px;color:#000;background-color:#f0f0f0;padding-left:3px;padding-right:3px;padding-top:5px;padding-bottom:5px;">
         <img src="https://plus.google.com/_/favicon?alt=feed&amp;domain=@feeds[i].Domain " style="height:24px;width:24px;" alt="@feeds[i].Domain"/>
         <i>@feeds[i].Domain</i>&nbsp;bfr&nbsp; <span> <span class="icon-time"></span>  <b><i class="timeago" title="@feeds[i].PubDate.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fff'Z'")">
                                                @feeds[i].PubDate</i> </b></span>
        
        </div>
	</div>
        
    }
        }
</div>


 @RenderPage("~/views/shared/_pagerView.cshtml")

<div style="width:100%;height:auto;border:1px solid black;background-color:black;text-align:center;">
<h2 style="color:white;">OUR RESPECTFUL NEWS SOURCES</h2>
</div>

 <div id="websiteContainer" style="width: 1100px;position:relative;margin:0 auto 25px;background-color:#505050;border-top:#000;">
    
      @{
                
          List<NewsMine.DomainObjects.WebSiteInfo> websites1 = new List<NewsMine.DomainObjects.WebSiteInfo>();

          websites1 = ((QResult)Model).CurrentLanguageWebsites;

          foreach (var website in websites1)
          {

              if (!string.IsNullOrEmpty(website.Logo1Uri))
              {
             
                <div class="grid" style="border-radius:25px;text-align:center;position:relative;border:1px solid lightgrey;">
		        
                <p>@website.Language</p>

                      <a class="name" style="text-decoration:none;text-align:center;left:50%;top:50%;" target="_self" href="/source/@website.Domain">

			        <img style="max-width:100px;max-height:100px;margin-left:auto;margin-right: auto;"  src="@website.Logo1Uri" />
                       <h5> @Html.Raw(website.Name) </h5>      
                
                </a>
              </div>

              }

          }

       }

    </div>


</section>
    <!-- Footer -->
    <footer id="footer" style="display: none;">
	<span>&copy; 2012 <a href="#">lookatnews.com</a>. Design by <a href="#contact">Surendra</a></span>
</footer>
</body>
</html> 